<template>
	<view>
		<u-navbar leftIconSize="0" title="首页" bgColor="transparent" placeholder></u-navbar>
		<view class="box zdy-flex zdy-flex-direction zdy-flex-center">
			<image class="avatar" :src="userInfo.avatarUrl || '/static/img/housing/lxr.png'" mode=""></image>
			<!-- <u--input
				disabledColor="#ffffff"
				inputAlign="center"
				disabled
				shape="circle"
				placeholder="请输入昵称"
				v-model="userInfo.nickName"
				suffixIcon="setting"
				suffixIconStyle="color: #94c7f6"
			></u--input> -->
			<view class="">
				{{ userInfo.nickName }}
			</view>
			<view class="" @click="isToken">
				<view class="add">创建房间</view>
				<view class="user">个人中心</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			userInfo: uni.getStorageSync('userInfo')
		};
	},
	onShow() {
		console.log(this.userInfo, '444');
	},
	methods: {
		isToken() {
			if (!uni.getStorageSync('userInfo').openid) {
				uni.reLaunch({
					url: '/pages/login'
				});
			}
		}
	}
};
</script>
<style>
page {
	background: linear-gradient(180deg, #94ceff 0%, #fbfbfb 100%);
}
</style>
<style scoped lang="scss">
.box {
	font-size: 32rpx;
}
.avatar {
	margin-top: 260rpx;
	margin-bottom: 30rpx;
	width: 230rpx;
	height: 230rpx;
	border-radius: 50%;
}
::v-deep .u-input--circle {
	width: 520rpx;
	padding: 15rpx 9rpx !important;
}
.add,
.user {
	height: 79rpx;
	line-height: 79rpx;
	margin: 30rpx;
	border-radius: 200rpx;
	background-color: #ffffff;
	text-align: center;
	width: 520rpx;
}
.add {
	color: #ffffff;
	background-color: #7db5e8;
}
</style>
